//
//  VideoAudioTableViewCell.swift
//  NDAi
//
//  Created by 丸子 on 2024/6/21.
//

import UIKit

class VideoAudioTableViewCell: UITableViewCell {
    lazy var lineView: UIView = {
        let view = UIView()
        view.backgroundColor = Theme.color.main
        view.allRound(3)
        return view
    }()
    
    lazy var titleLb: UILabel = {
        let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 15)
        label.textColor = Theme.color.main
        label.text = "人物配音"
        return label
    }()
    
    private lazy var backView: UIView = {
        let view = UIView()
        view.backgroundColor = .white
        view.allRound(8)
        return view
    }()
    
    lazy var iconIV: UIImageView = {
        let imageView = UIImageView()
        imageView.image = UIImage(named: "icon_video_copy")
        imageView.contentMode = .scaleToFill
        imageView.clipsToBounds = true
        return imageView
    }()
    
    lazy var sgLb: UILabel = {
        let label = UILabel()
        label.textColor = Theme.color.text_d1
        label.font = UIFont.pingFangSCRegular(ofSize: 14)
        label.textAlignment = .center
        label.text = "啊"
        return label
    }()
    
    private lazy var moreIV: UIImageView = {
        let imageView = UIImageView()
        imageView.image = UIImage(named: "icon_Mine_更多")
        imageView.contentMode = .scaleToFill
        imageView.clipsToBounds = true
        return imageView
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        backgroundColor = .clear
        selectionStyle = .none
        contentView.addSubviews([lineView, titleLb, backView])
        backView.addSubviews([iconIV, sgLb, moreIV])
        lineView.snp.makeConstraints { make in
            make.top.equalTo(20)
            make.leading.equalTo(16)
            make.width.equalTo(6)
            make.height.equalTo(16)
        }
        
        titleLb.snp.makeConstraints { make in
            make.centerY.equalTo(lineView)
            make.leading.equalTo(lineView.snp.trailing).offset(8)
        }
        
        backView.snp.makeConstraints { make in
            make.top.equalTo(lineView.snp.bottom).offset(10)
            make.leading.trailing.equalToSuperview().inset(16)
            make.height.equalTo(56)
        }
        
        iconIV.snp.makeConstraints { make in
            make.leading.equalToSuperview().offset(12)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(34)
        }
        
        sgLb.snp.makeConstraints { make in
            make.leading.equalTo(iconIV.snp.trailing).offset(10)
            make.centerY.equalToSuperview()
        }
        
        moreIV.snp.makeConstraints { make in
            make.trailing.equalToSuperview().offset(-15)
            make.centerY.equalToSuperview()
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
